package com.naiterui.ehp.bp.bo.doctor;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.builder.ToStringBuilder;

import java.io.Serializable;

/**
 * 医生审核认证/备案结果BO
 */
@Data
public class DoctorAuditParamBO implements Serializable {

    private static final long serialVersionUID = -8223911565094845425L;

    /**
     * 审核不通过-医生帐号认证状态
     */
    private static final int AUTH_STATUS_REJECTED = 3;

    /**
     * 医生ID
     */
    @ApiModelProperty(value = "医生id")
    private Long doctorId;


    @ApiModelProperty(value = "2:审核通过3:审核不通过")
    private Integer status;

    /**
     * 审核描述
     */
    @ApiModelProperty(value = "审核描述")
    private String failureReason;

    public boolean validate() {
        return doctorId == null || doctorId == 0 || status == null || (status == AUTH_STATUS_REJECTED && StringUtils.isBlank(failureReason));
    }

    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this);
    }
}
